<!DOCTYPE html>
<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="content-type">
    <meta name="viewport" content="width=device-width, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="css/common.css">
    <link rel="stylesheet" type="text/css" href="css/range.css">
    <!--link rel="stylesheet" type="text/css" href="css/the_all.css" -->
    <title>luOS IoT PWM control page</title>
    <script language="javascript" type="text/javascript">
  
	function get_cb(rd_ch) {
		var cmd = "pwm[" + rd_ch + "]=-1.0";      
		doSend(cmd);
		
		rcvd_tm = 400;
		
		if(rd_ch >= 15){
			rd_ch = 16;
		}else
			rd_ch++;
		
		return rd_ch;
	}

	function set_label_val_cb(el, val) {
		el.innerHTML = " " + val + "%";
	}

	function set_ctl_state_cb(el, val) {
		el.value = parseFloat(val);
	}
</script> <script type="text/javascript" src="js/common.js"></script>
    <script language="javascript" type="text/javascript">
	function sndPwmSldr(pwm_num) {
		var v = document.getElementById("pwm[" + pwm_num + "]g").value;
		var cmd = "pwm[" + pwm_num + "]=" + v;      
		doSend(cmd);
	}
</script> </head>
  <body>
    <ul class="navbar">
      <li><a href="/">Home</a></li>
      <li><a href="pio_dev.html">PIO dev</a></li>
      <li><a class="active" href="pwm_dev.html">PWM dev</a></li>
      <li><a href="adc_dac_dev.html">ADC-DAC dev</a></li>
      <li><a href="about.html">About</a></li>
      <li><a href="test.lua?hello=world&amp;test=CGI">Test Lua CGI</a></li>
    </ul>
    <div>
      <!-- class="grid main"> -->
      <h1>PWMs Test</h1>
      <div align="center"> 
        <table><tr>
        <td><div id="status_box">Loading..</div></td>
        <td><input value="Refresh Data" onclick="do_refresh();" type="button"></td>
        </tr></table>
      <div class="cover" style="width: 95%; margin: 0 auto;">
        <table style="width: 100%;">
          <!-- width="95%" align="middle"> -->
          <tbody>
            <tr>
              <td> <span style="color: violet; font-size: 18px;">General mode
                  PWMs:</span> </td>
            </tr>
            <tr>
              <td> <input min="0.0" max="100.0" step="0.1" name="lbutton8" id="pwm[0]g"
                  oninput="sndPwmSldr(0)" type="range"> <label for="pwm[0]g">PWM
                  1 (0) =<span style="color:green;" id="pwm[0]"> 50.0%</span></label>
              </td>
            </tr>
            <tr>
              <td> <input min="0.0" max="100.0" step="0.1" name="lbutton8" id="pwm[1]g"
                  oninput="sndPwmSldr(1)" type="range"> <label for="pwm[1]g">PWM
                  2 (1) =<span style="color:green;" id="pwm[1]"> 50.0%</span></label>
              </td>
            </tr>
            <tr>
              <td> <input min="0.0" max="100.0" step="0.1" name="lbutton8" id="pwm[2]g"
                  oninput="sndPwmSldr(2)" type="range"> <label for="pwm[2]g">PWM
                  3 (2) =<span style="color:green;" id="pwm[2]"> 50.0%</span></label>
              </td>
            </tr>
            <tr>
              <td> <input min="0.0" max="100.0" step="0.1" name="lbutton8" id="pwm[3]g"
                  oninput="sndPwmSldr(3)" type="range"> <label for="pwm[3]g">PWM
                  4 (3) =<span style="color:green;" id="pwm[3]"> 50.0%</span></label>
              </td>
            </tr>
            <tr>
              <td> <input min="0.0" max="100.0" step="0.1" name="lbutton8" id="pwm[4]g"
                  oninput="sndPwmSldr(4)" type="range"> <label for="pwm[4]g">PWM
                  5 (4) =<span style="color:green;" id="pwm[4]"> 50.0%</span></label>
              </td>
            </tr>
            <tr>
              <td> <span style="color: violet; font-size: 18px;">PCB signal
                  LEDs:</span> </td>
            </tr>
            <tr>
              <td> <input min="0.0" max="100.0" step="0.1" name="lbutton8" id="pwm[5]g"
                  oninput="sndPwmSldr(5)" type="range"> <label for="pwm[5]g">Sign
                  1 (5) =<span style="color:green;" id="pwm[5]"> 50.0%</span></label>
              </td>
            </tr>
            <tr>
              <td> <input min="0.0" max="100.0" step="0.1" name="lbutton8" id="pwm[6]g"
                  oninput="sndPwmSldr(6)" type="range"> <label for="pwm[6]g">Sign
                  0 (6) =<span style="color:green;" id="pwm[6]"> 50.0%</span></label>
              </td>
            </tr>
            <tr>
              <td> <span style="color: violet; font-size: 18px;">DC output
                  PWMs:</span> </td>
            </tr>
            <tr>
              <td> <input min="0.0" max="100.0" step="0.1" name="lbutton8" id="pwm[7]g"
                  oninput="sndPwmSldr(7)" type="range"> <label for="pwm[7]g">DC
                  3 (7) =<span style="color:green;" id="pwm[7]"> 50.0%</span></label>
              </td>
            </tr>
            <tr>
              <td> <input min="0.0" max="100.0" step="0.1" name="lbutton8" id="pwm[8]g"
                  oninput="sndPwmSldr(8)" type="range"> <label for="pwm[8]g">DC
                  2 (8) =<span style="color:green;" id="pwm[8]"> 50.0%</span></label>
              </td>
            </tr>
            <tr>
              <td> <input min="0.0" max="100.0" step="0.1" name="lbutton8" id="pwm[9]g"
                  oninput="sndPwmSldr(9)" type="range"> <label for="pwm[9]g">DC
                  1 (9) =<span style="color:green;" id="pwm[9]"> 50.0%</span></label>
              </td>
            </tr>
            <tr>
              <td> <span style="color: violet; font-size: 18px;">Power Led
                  PWMs:</span> </td>
            </tr>
            <tr>
              <td> <input min="0.0" max="100.0" step="0.1" name="lbutton8" id="pwm[10]g"
                  oninput="sndPwmSldr(10)" type="range"> <label for="pwm[10]g">Led
                  1 (10) =<span style="color:green;" id="pwm[10]"> 50.0%</span></label>
              </td>
            </tr>
            <tr>
              <td> <input min="0.0" max="100.0" step="0.1" name="lbutton8" id="pwm[11]g"
                  oninput="sndPwmSldr(11)" type="range"> <label for="pwm[11]g">Led
                  2 (11) =<span style="color:green;" id="pwm[11]"> 50.0%</span></label>
              </td>
            </tr>
            <tr>
              <td> <input min="0.0" max="100.0" step="0.1" name="lbutton8" id="pwm[12]g"
                  oninput="sndPwmSldr(12)" type="range"> <label for="pwm[12]g">Led
                  3 (12) =<span style="color:green;" id="pwm[12]"> 50.0%</span></label>
              </td>
            </tr>
            <tr>
              <td> <input min="0.0" max="100.0" step="0.1" name="lbutton8" id="pwm[13]g"
                  oninput="sndPwmSldr(13)" type="range"> <label for="pwm[13]g">Led
                  4 (13) =<span style="color:green;" id="pwm[13]"> 50.0%</span></label>
              </td>
            </tr>
            <tr>
              <td> <input min="0.0" max="100.0" step="0.1" name="lbutton8" id="pwm[14]g"
                  oninput="sndPwmSldr(14)" type="range"> <label for="pwm[14]g">Led
                  5 (14) =<span style="color:green;" id="pwm[14]"> 50.0%</span></label>
              </td>
            </tr>
            <tr>
              <td> <input min="0.0" max="100.0" step="0.1" name="lbutton8" id="pwm[15]g"
                  oninput="sndPwmSldr(15)" type="range"> <label for="pwm[15]g">Led
                  6 (15) =<span style="color:green;" id="pwm[15]"> 50.0%</span></label>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
    
  </body>
</html>
